﻿<DataListSpec
    xmlns="bb_appfx_datalist"
    xmlns:c="bb_appfx_commontypes" 
    ID="025bd27e-1d5d-46e5-ad0f-f99eecaac052" 
    Name="TDSM Organizational Minimum Thresholds Data List"
    Description="Holds organizations and their minimum thresholds for the TDSM Datalist" 
    Author="Blackbaud Professional Services">
    
    <SPDataList SPName="USR_USP_DATALIST_TDSM_ORG_THRESHOLDS">
		<c:CreateProcedureSQL>
			<![CDATA[
create procedure dbo.USR_USP_DATALIST_TDSM_ORG_THRESHOLDS
as
set nocount on;
SELECT
  BUC.ID
 ,BUC.DESCRIPTION AS BUSINESSUNIT
 ,ISNULL(UBUC.THRESHOLD,0) AS THRESHOLD
FROM
  BUSINESSUNITCODE BUC
  INNER JOIN
  USR_BUSINESSUNITCODE UBUC
  ON UBUC.ID = BUC.ID
WHERE 1=1
  AND BUC.ACTIVE=1
ORDER BY
  BUC.SEQUENCE;
]]>
		</c:CreateProcedureSQL>
	</SPDataList>

	<Output>
		<OutputFields>
            <OutputField FieldID="ID" Caption="Hierarchy ID" IsHidden="true" DataType="Guid" />
            <OutputField FieldID="BUSINESSUNIT" Caption="Business unit" DataType="String"/>
            <OutputField FieldID="THRESHOLD" Caption="Minimum $ Threshold" DataType="Money"/>
		</OutputFields>
	</Output>
</DataListSpec>
